#include "Window.h"

#ifdef PSX_PLATFORM_WINDOWS_WINDOW

#ifdef PSX_DEBUG
#pragma comment(lib,"Pulse-Tecd.lib")
#else
#pragma comment(lib,"Pulse-Tec.lib")
#endif

namespace Pulse
{
	
	PSX_REGISTER_APPLICATION_CREATE( AppWindow );
	PSX_REGISTER_APPLICATION_RELEASE();

	AppWindow::AppWindow( void )
	{

	}

	BOOL AppWindow::OnStart( void )
	{
		SetApplicationName( PSX_String("Demo Application") );

		Engine *pEngine = Engine::GetInstance();

		m_pLogic = new AppLogic;
		pEngine->SetApplicationLogic( m_pLogic );

		m_pLogic->AddView( new AppView );

		//this->ShowFPS( TRUE );
		//ToggleFullscreen();

		/*GraphicsResourceManager *pGM = GraphicsResourceManager::GetInstance();
		
		RenderTechniqueDesc techDesc;
		techDesc.SetToLoad(PSX_String("SampleTechnique.tch"));

		RenderTechnique *pTech = pGM->CreateRenderTechnique( &techDesc );
		
		GeometryDesc desc;
		desc.SetToLoad( PSX_String("Resources\\Models\\Geometry\\poop.xml") );
		desc.SetToLoad( PSX_String("poop.xml") );
		
		pGM->CreateGeometry( PSX_String("sampleGeometry"), &desc );

		return TRUE;

		FBXUtility util;

		util.LoadScene( PSX_String("Resources\\Models\\box.fbx") );
		util.TriangulateScene();
		util.ExportGeometry();*/

		//ProcessModel( PSX_String("Resources\\Models\\cude.dae") );

		this->ShowFPS( TRUE );

		return TRUE;
	}

	void AppWindow::OnCommandLine( String commandLine )
	{


	}

	void AppWindow::OnUpdate( DOUBLE time, FLOAT dt, void *pContext )
	{
		//Terminate();

	}

	void AppWindow::OnShutDown( void )
	{

	}
}

#endif /* PSX_PLATFORM_WINDOWS_WINDOW */